home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / biz / demo / Electrics_demo.lha / AShell.rexx < prev    next >
OS/2 REXX Batch file  |  1996-02-28  |  822b  |  52 lines

  1. /*------------------------------*/ 
  2. /* Electrics ARexx Shell script */
  3. /*------------------------------*/
  4.  
  5. OPTIONS PROMPT "2;>0m>>m"
  6. OPTIONS RESULTS
  7. RC = 0
  8.  
  9. say "Enter 'HELP' for help."
  10. say ""
  11.  
  12. error:
  13.   SIGNAL ON error
  14.   if RC ~= 0 THEN DO
  15.     SAY "+++ ERROR: RC = " RC
  16.     RC = 0
  17.   END
  18.   
  19. syntax:
  20.   SIGNAL ON syntax
  21.   if RC ~= 0 THEN DO
  22.     SAY "+++ SYNTAX ERROR:" ERRORTEXT(RC)
  23.     RC = 0
  24.   END
  25.  
  26. DO FOREVER
  27.   PARSE PULL shell_line
  28.   
  29.   if UPPER(shell_line) == 'QUIT' THEN DO
  30.     address COMMAND endcli
  31.     EXIT
  32.   END
  33.     
  34.   else if UPPER(shell_line) == 'HELP' THEN DO
  35.     say ""
  36.     say "QUIT: Exit the ARexx Shell."
  37.     say "HELP: Displays this help."
  38.     say ""
  39.   end
  40.   
  41.   else do
  42.     interpret shell_line
  43.     
  44.     if RESULT ~= 'RESULT' THEN DO
  45.       say RESULT
  46.       RESULT = 'RESULT'
  47.     END
  48.   END
  49.   
  50. END
  51.  
  52.